NATO01 =mean(kos$NATO01),
socialism =mean(kos$socialism),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
percent_muslim_arda=mean(kos$percent_muslim_arda,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("rr_additive_index","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = rr_additive_index, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Religious Regulation",
y="Probability of Recognition")
b
ggsave(file="relregulationx.pdf",width=7,height=7)
rm(list = ls())
kos<-read.dta("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\Kosovo Dataset.dta")
m1<-lmer(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian+ (1|regnum), REML=T, data=kos)
summary(m1)
summary(kos$rr_additive_index)
0.02203/(0.02203+0.17492)
m2<-lmer(kosovo_recognition_dummy~ (1|regnum), REML=T, data=kos)
summary(m2)
0.05294/(0.05294+0.21206)
kos$NATO01[kos$NATO2007=="No"]<-0
kos$NATO01[kos$NATO2007=="Yes"]<-1
l1<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l1)
stargazer(vif(l1))
l2<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+
Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l2)
a<-anova(m1,test = "Chisq")
xtable(a)
texreg(a)
texreg(list(l1,m1),booktabs = TRUE, dcolumn = TRUE)
dat <- data.frame(rr_additive_index = rep(seq(from = min(kos$rr_additive_index,na.rm=T),
to = max(kos$rr_additive_index,na.rm=T), length.out = 1000)),
NATO01 =mean(kos$NATO01),
socialism =mean(kos$socialism),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
percent_muslim_arda=mean(kos$percent_muslim_arda,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("rr_additive_index","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = rr_additive_index, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Religious Regulation",
y="Probability of Recognition")
b
ggsave(file="relregulationx.pdf",width=7,height=7)
rm(list = ls())
starting overplot()
##starting over##
setwd("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\")
kos<-read.dta("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\Kosovo Dataset_v2_dh.dta")
setwd("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\")
kos<-read.dta("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\Kosovo Dataset_v3_dh.dta")
m1<-lmer(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian+ (1|regnum), REML=T, data=kos)
summary(m1)
summary(kos$rr_additive_index)
0.02203/(0.02203+0.17492)
m2<-lmer(kosovo_recognition_dummy~ (1|regnum), REML=T, data=kos)
summary(m2)
0.05294/(0.05294+0.21206)
l1<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l1)
stargazer(vif(l1))
l2<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+
Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l2)
a<-anova(m1,test = "Chisq")
xtable(a)
texreg(a)
texreg(list(l1,m1),booktabs = TRUE, dcolumn = TRUE)
dat <- data.frame(rr_additive_index = rep(seq(from = min(kos$rr_additive_index,na.rm=T),
to = max(kos$rr_additive_index,na.rm=T), length.out = 1000)),
NATO01 =mean(kos$NATO01),
socialism =mean(kos$socialism),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
percent_muslim_arda=mean(kos$percent_muslim_arda,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("rr_additive_index","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = rr_additive_index, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Religious Regulation",
y="Probability of Recognition")
b
ggsave(file="relregulationx.pdf",width=7,height=7)
rm(list = ls())
setwd("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\")
kos<-read.dta("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\Kosovo Dataset.dta")
m1<-lmer(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian+ (1|regnum), REML=T, data=kos)
summary(m1)
summary(kos$rr_additive_index)
0.02203/(0.02203+0.17492)
m2<-lmer(kosovo_recognition_dummy~ (1|regnum), REML=T, data=kos)
summary(m2)
0.05294/(0.05294+0.21206)
kos$NATO01[kos$NATO2007=="No"]<-0
kos$NATO01[kos$NATO2007=="Yes"]<-1
View(kos)
l1<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l1)
stargazer(vif(l1))
l2<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+
Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l2)
a<-anova(m1,test = "Chisq")
xtable(a)
texreg(a)
texreg(list(l1,m1),booktabs = TRUE, dcolumn = TRUE)
###marginal effects based on model l1
#recognition
dat <- data.frame(rr_additive_index = rep(seq(from = min(kos$rr_additive_index,na.rm=T),
to = max(kos$rr_additive_index,na.rm=T), length.out = 1000)),
NATO01 =mean(kos$NATO01),
socialism =mean(kos$socialism),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
percent_muslim_arda=mean(kos$percent_muslim_arda,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("rr_additive_index","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = rr_additive_index, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Religious Regulation",
y="Probability of Recognition")
b
ggsave(file="relregulationx.pdf",width=7,height=7)
sum(l1)
summary(l1)
rm(list = ls()
)
library(verification)
library(car)
library(gmodels)
library(xtable)
library(effects)
library(separationplot)
library(pscl)
library(MCMCpack)
library(UsingR)
library(Zelig) #v.3.5
library(gdata)
library(gplots)
library(foreign)
library(lme4)
library(nlme)
library(texreg)
library(stargazer)
library(ggplot2)
library(reshape2)
library(ggcorrplot)
setwd("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\")
kos<-read.dta("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\Kosovo Dataset.dta")
m1<-lmer(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian+ (1|regnum), REML=T, data=kos)
summary(m1)
summary(kos$rr_additive_index)
0.02203/(0.02203+0.17492)
m2<-lmer(kosovo_recognition_dummy~ (1|regnum), REML=T, data=kos)
summary(m2)
0.05294/(0.05294+0.21206)
kos$NATO01[kos$NATO2007=="No"]<-0
kos$NATO01[kos$NATO2007=="Yes"]<-1
l1<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l1)
stargazer(vif(l1))
l2<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+
Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l2)
a<-anova(m1,test = "Chisq")
xtable(a)
texreg(a)
texreg(list(l1,m1),booktabs = TRUE, dcolumn = TRUE)
###marginal effects based on model l1
#recognition
dat <- data.frame(rr_additive_index = rep(seq(from = min(kos$rr_additive_index,na.rm=T),
to = max(kos$rr_additive_index,na.rm=T), length.out = 1000)),
NATO01 =mean(kos$NATO01),
socialism =mean(kos$socialism),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
percent_muslim_arda=mean(kos$percent_muslim_arda,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("rr_additive_index","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = rr_additive_index, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Religious Regulation",
y="Probability of Recognition")
b
ggsave(file="relregulationx.pdf",width=7,height=7)
rm(list = ls())
setwd("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\")
kos<-read.dta("C:\\Users\\Daniel\\Dropbox\\Journal (II)\\Replication Files\\Mirilovic\\Kosovo Dataset.dta")
m1<-lmer(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian+ (1|regnum), REML=T, data=kos)
summary(m1)
summary(kos$rr_additive_index)
0.02203/(0.02203+0.17492)
m2<-lmer(kosovo_recognition_dummy~ (1|regnum), REML=T, data=kos)
summary(m2)
0.05294/(0.05294+0.21206)
kos$NATO01[kos$NATO2007=="No"]<-0
kos$NATO01[kos$NATO2007=="Yes"]<-1
l1<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l1)
stargazer(vif(l1))
l2<-glm(kosovo_recognition_dummy~NATO01+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+
Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, family=binomial(link="logit"),
data=kos)
summary(l2)
a<-anova(m1,test = "Chisq")
xtable(a)
texreg(a)
texreg(list(l1,m1),booktabs = TRUE, dcolumn = TRUE)
###marginal effects based on model l1
#recognition
dat <- data.frame(rr_additive_index = rep(seq(from = min(kos$rr_additive_index,na.rm=T),
to = max(kos$rr_additive_index,na.rm=T), length.out = 1000)),
NATO01 =mean(kos$NATO01,na.rm=T),
socialism =mean(kos$socialism,na.rm=T),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
percent_muslim_arda=mean(kos$percent_muslim_arda,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("rr_additive_index","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = rr_additive_index, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Religious Regulation",
y="Probability of Recognition")
b
ggsave(file="relregulationx.pdf",width=7,height=7)
###
dat <- data.frame(percent_muslim_arda = rep(seq(from = min(kos$percent_muslim_arda,na.rm=T),
to = max(kos$percent_muslim_arda,na.rm=T), length.out = 1000)),
NATO01 =mean(kos$NATO01,na.rm=T),
socialism =mean(kos$socialism,na.rm=T),
gdppc2007 =mean(kos$gdppc2007,na.rm=T),
usfdigdp19901999_modified =mean(kos$usfdigdp19901999_modified,na.rm=T),
dem2007=mean(kos$dem2007,na.rm=T),
Griffiths=mean(kos$Griffiths,na.rm=T),
ethnic_diversity_alesina=mean(kos$ethnic_diversity_alesina,na.rm=T),
belgrad_distance=mean(kos$belgrad_distance,na.rm=T),
rr_additive_index=mean(kos$rr_additive_index,na.rm=T),
percent_albanian=mean(kos$percent_albanian,na.rm=T))
ndat <- cbind(dat, predict(l1, newdata=dat, type = "response",se.fit=T))
newdat <- melt(ndat, id.vars = c("percent_muslim_arda","fit","se.fit"))
newdat2 <- newdat[1:1000,]
newdat2$ucl <- newdat2$fit + 1.96 * newdat2$se.fit
newdat2$lcl <- newdat2$fit - 1.96 * newdat2$se.fit
tail(newdat2)
b<-ggplot(newdat2, aes(x = percent_muslim_arda, y = fit)) +
geom_smooth(aes(ymin = lcl, ymax = ucl), stat="identity")+
labs(title = "", x="Percent Muslim",
y="Probability of Recognition")
b
ggsave(file="percentmuslimtest.pdf",width=7,height=7)
posterior <- MCMClogit(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian,
data=kos)
plot(posterior)
z1<-zelig(kosovo_recognition_dummy~NATO2007+socialism+gdppc2007+
usfdigdp19901999_modified+dem2007+percent_muslim_arda+
rr_additive_index+ Griffiths+ ethnic_diversity_alesina+
belgrad_distance+ percent_albanian, model="logit",
data=kos)
summary(z1)
#NATO membership effect
lo<-setx(z1, NATO2007 = "No")
hi<-setx(z1, NATO2007 = "Yes")
slo<- sim(z1, x = lo)
shi<- sim(z1, x = hi)
summary(slo)
summary(shi)
low<-melt(slo$qi$ev)
high<-melt(shi$qi$ev)
ll<-data.frame(level=rep("No NATO Membership"), low)
hh<-data.frame(level=rep("NATO Membership"), high)
hl<-rbind(hh,ll)
g<-ggplot(hl, aes(x=level, y=value))
g+  geom_boxplot()+
ylab("Probability of Recognition") +
xlab("")+
ylim(0,1)
ggsave("nato01x.pdf",width=7,height=7)
dev.off()
##domestic vulnerability effect
lo<-setx(z1, Griffiths = 0)
hi<-setx(z1, Griffiths = 1)
slo<- sim(z1, x = lo)
shi<- sim(z1, x = hi)
low<-melt(slo$qi$ev)
high<-melt(shi$qi$ev)
ll<-data.frame(level=rep("Not Vulnerable"), low)
hh<-data.frame(level=rep("Vulnerable"), high)
hl<-rbind(hh,ll)
g<-ggplot(hl, aes(x=level, y=value))
g+  geom_boxplot()+
ylab("Probability of Recognition") +
xlab("")+
ylim(0,1)
ggsave("vulnerable01x.pdf",width=7,height=7)
dev.off()
myvars<-c("NATO01","socialism","gdppc2007",
"usfdigdp19901999_modified","dem2007","percent_muslim_arda",
"rr_additive_index", "Griffiths", "ethnic_diversity_alesina",
"belgrad_distance", "percent_albanian")
kos2<-kos[myvars]
library(data.table)
setnames(kos2,"NATO01","NATO")
setnames(kos2,"socialism","Socialism")
setnames(kos2,"gdppc2007","GDPpc")
setnames(kos2,"usfdigdp19901999_modified","USFDI")
setnames(kos2,"dem2007","Democracy")
setnames(kos2,"percent_muslim_arda","Muslim")
setnames(kos2,"rr_additive_index","Regulation")
setnames(kos2,"Griffiths","Vulnerable")
setnames(kos2,"ethnic_diversity_alesina","Diversity")
setnames(kos2,"belgrad_distance","Distance")
setnames(kos2,"percent_albanian","Albanian")
corr <- round(cor(kos2), 1)
corr
xtable(corr)
ggcorrplot(corr, hc.order = TRUE,
lab = F,legend.title = "")
ggsave("corr_nolabx.pdf",width=7,height=7)
dev.off()
library(verification)
library(car)
library(gmodels)
library(xtable)
library(effects)
library(separationplot)
library(pscl)
library(MCMCpack)
library(UsingR)
library(Zelig) #v.3.5
library(gdata)
library(gplots)
library(foreign)
library(lme4)
library(nlme)
library(texreg)
library(stargazer)
library(ggplot2)
library(reshape2)
library(ggcorrplot)
#NATO membership effect
lo<-setx(z1, NATO2007 = "No")
hi<-setx(z1, NATO2007 = "Yes")
slo<- sim(z1, x = lo)
shi<- sim(z1, x = hi)
summary(slo)
summary(shi)
low<-melt(slo$qi$ev)
high<-melt(shi$qi$ev)
ll<-data.frame(level=rep("No NATO Membership"), low)
hh<-data.frame(level=rep("NATO Membership"), high)
hl<-rbind(hh,ll)
g<-ggplot(hl, aes(x=level, y=value))
g+  geom_boxplot()+
ylab("Probability of Recognition") +
xlab("")+
ylim(0,1)
ggsave("nato01x.pdf",width=7,height=7)
dev.off()
##domestic vulnerability effect
lo<-setx(z1, Griffiths = 0)
hi<-setx(z1, Griffiths = 1)
slo<- sim(z1, x = lo)
shi<- sim(z1, x = hi)
low<-melt(slo$qi$ev)
high<-melt(shi$qi$ev)
ll<-data.frame(level=rep("Not Vulnerable"), low)
hh<-data.frame(level=rep("Vulnerable"), high)
hl<-rbind(hh,ll)
g<-ggplot(hl, aes(x=level, y=value))
g+  geom_boxplot()+
ylab("Probability of Recognition") +
xlab("")+
ylim(0,1)
ggsave("vulnerable01x.pdf",width=7,height=7)
dev.off()
myvars<-c("NATO01","socialism","gdppc2007",
"usfdigdp19901999_modified","dem2007","percent_muslim_arda",
"rr_additive_index", "Griffiths", "ethnic_diversity_alesina",
"belgrad_distance", "percent_albanian")
kos2<-kos[myvars]
library(data.table)
setnames(kos2,"NATO01","NATO")
setnames(kos2,"socialism","Socialism")
setnames(kos2,"gdppc2007","GDPpc")
setnames(kos2,"usfdigdp19901999_modified","USFDI")
setnames(kos2,"dem2007","Democracy")
setnames(kos2,"percent_muslim_arda","Muslim")
setnames(kos2,"rr_additive_index","Regulation")
setnames(kos2,"Griffiths","Vulnerable")
setnames(kos2,"ethnic_diversity_alesina","Diversity")
setnames(kos2,"belgrad_distance","Distance")
setnames(kos2,"percent_albanian","Albanian")
corr <- round(cor(kos2), 1)
corr
xtable(corr)
ggcorrplot(corr, hc.order = TRUE,
lab = F,legend.title = "")
ggsave("corr_nolabx.pdf",width=7,height=7)
dev.off()
htmlreg(list(m1,m2,l1,l2),file=("tab1.doc"))
htmlreg(list(l1,m1,l2),file=("tab1_redo.doc"))
